/*
 * class name: stdui$,
 * copyright: maximus zhang,
 * License: MIT-LICENSE,
 * contact: maximus.zhang@gmail.com,
 * required-js: http://hcjs.googlecode.com/svn/trunk/hc.js,
 * update: http://hcjs.googlecode.com/svn/trunk/stdui.js
 * -------
 * todo: bind keys event
 */
function stdui$(){
    var A = arguments,
        _ = this;
    _ = ext$( _, ext$( {
            menu : {
                id : 'xmenu',
                height : 25
            },
            main : {
                id : 'xbody',
                bgcolor : '#f9f9f9'
            },
            status : {
                id : 'xstatus',
                height : 28,
                bgcolor : '#e3edf9'
            }
        }, A[0], 1 ) );

    _.uitype = 'stdui$';
}

stdui$.prototype = {
    init$ : function() {
        var uihtml = me.documentElement;
        uihtml.style.cssText = 'padding:0 !important;padding:'
            + this.menu.height +'px 0 '+ this.status.height +'px 0;';

        var uimenu = el$( 'div' ).before$();
        uimenu.id = this.menu.id;
        with ( uimenu.style ) {
            position = 'absolute';
            top = left = 0;
            width = '100%';
            height = this.menu.height +'px';
        }

        var uimain = el$( 'div' ).after$( uimenu );
        uimain.id = this.main.id;
        uimain.style.cssText = 'height:auto !important;height:100%;';
        with ( uimain.style ) {
            position = 'absolute';
            top = this.menu.height +'px';
            bottom = this.status.height +'px';
            left = right = 0;
            width = '100%';
            overflow = 'auto';
            backgroundColor = this.main.bgcolor;
        }

        var uistatus = el$( 'div' ).after$( uimain );
        uistatus.id = this.status.id;
        with ( uistatus.style ) {
            position = 'absolute';
            bottom = left = 0;
            width = '100%';
            lineHeight = height = this.status.height-1 +'px';
            textAlign = 'center';
            borderTop = 'solid lightblue 1px';
            backgroundColor = this.status.bgcolor;
        }

    return this;
    },

    getres$ : function() {
        var _ = this,
            A = arguments;
        _ = ext$( _, ext$( {
            url : ''
            }, A[0] ) );

        if ( p$( _, 'url' ) ) {
            _.xml = xml$( _.url );
            _.$ = jsonDOM$( _.xml, 1 );

        }

    return this;
    }

}
